<!DOCTYPE HTML>
<html>
 <head>
  <title>Forms</title>
  <script src="../../resources/testharness.js"></script>
  <script src="../../resources/testharnessreport.js"></script>
 </head>
 <body>
  <p>
    <h3>keygen_labels</h3>
  </p>
  
  <hr>

  <div id="log"></div>

  <form method="post"
      enctype="application/x-www-form-urlencoded"
      action="" 
      id="input_form">
   <p><label>Full name<label>(name):<keygen name='key1' id='keygen_id1'></keygen></label></label></p>
   <p><label>Age:<keygen name='key2' id='keygen_id2'></keygen></label></p>
  </form>
  <script>

    var keygen1 = document.getElementById("keygen_id1");
    var keygen2 = document.getElementById("keygen_id2");

    if (typeof(keygen1.labels) == "object") {
      if (keygen1.labels.length == 2 && keygen2.labels.length == 1) {
        test(function() {
          assert_true(true, "labels attribute is correct.");
        });
      } else {
        test(function() {
          assert_unreached("labels attribute is not correct.");
        });
      }
    } else {
      test(function() {
        assert_unreached("labels attribute is not exist.");
      });
    }

  </script>

 </body>
</html>